<template>
  <div class="wapper">
    <swiper :options="swiperOption" v-if="showSwiper" >
      <!-- slides -->
      <swiper-slide v-for="item in list" :key='item.id'> 
        <img :src="item.imgurl" alt=""/>
      </swiper-slide>
      

      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  props:{
    list:Array
  },
  data() {
    return {
      swiperOption: {
        pagination: {
          el: ".swiper-pagination"
        },
        loop:false
      },
      // swiperList:[
      //     {id:'0001',imgurl:'http://h-des-activity-fecp.qunarzz.com/h_des_activity_fe_h_des_activity_fe/973dc1ae0da73a58410186df08ff25cb.jpg'}
      //     ,{id:'0002',imgurl:'http://h-des-activity-fecp.qunarzz.com/h_des_activity_fe_h_des_activity_fe/973dc1ae0da73a58410186df08ff25cb.jpg'}
      // ]
    };
  },
  computed:{
    showSwiper:function(){
      return this.list.length
    }
  },
  mounted:function(){
    console.log('传递过来的list是',this.list)
  },
  name: "homeSwiper"
};
</script>
<style lang='stylus' scoped>


</style>


